﻿using System;
using System.Text;

namespace ExText4SmallBasic
{
	///<summary>
	///The Text object provides helpful operations for working with Text.
	///</summary>
	[Microsoft.SmallBasic.Library.SmallBasicType]
	public static partial class Text
	{
		///<summary>
		///Appends two text inputs and returns the result as another text.  This operation is particularly useful when dealing with unknown text in variables which could accidentally be treated as numbers and get added, instead of getting appended.
		///</summary><param name="text1">
		///First part of the text to be appended.
		///</param><param name="text2">
		///Second part of the text to be appended.
		///</param><returns>
		///The appended text containing both the specified parts.
		///</returns>
		public static Microsoft.SmallBasic.Library.Primitive Append(Microsoft.SmallBasic.Library.Primitive text1,Microsoft.SmallBasic.Library.Primitive text2)
		{
			return Microsoft.SmallBasic.Library.Text.Append(text1,text2);
		}

		///<summary>
		///Gets the length of the given text.
		///</summary><param name="text">
		///The text whose length is needed.
		///</param><returns>
		///The length of the given text.
		///</returns>
		public static Microsoft.SmallBasic.Library.Primitive GetLength(Microsoft.SmallBasic.Library.Primitive text)
		{
			return Microsoft.SmallBasic.Library.Text.GetLength(text);
		}

		///<summary>
		///Gets whether or not a given subText is a subset of the larger text.
		///</summary><param name="text">
		///The larger text within which the sub-text will be searched.
		///</param><param name="subText">
		///The sub-text to search for.
		///</param><returns>
		///True if the subtext was found within the given text.
		///</returns>
		public static Microsoft.SmallBasic.Library.Primitive IsSubText(Microsoft.SmallBasic.Library.Primitive text,Microsoft.SmallBasic.Library.Primitive subText)
		{
			return Microsoft.SmallBasic.Library.Text.IsSubText(text,subText);
		}

		///<summary>
		///Gets whether or not a given text ends with the specified subText.
		///</summary><param name="text">
		///The larger text to search within.
		///</param><param name="subText">
		///The sub-text to search for.
		///</param><returns>
		///True if the subtext was found at the end of the given text.
		///</returns>
		public static Microsoft.SmallBasic.Library.Primitive EndsWith(Microsoft.SmallBasic.Library.Primitive text,Microsoft.SmallBasic.Library.Primitive subText)
		{
			return Microsoft.SmallBasic.Library.Text.EndsWith(text,subText);
		}

		///<summary>
		///Gets whether or not a given text starts with the specified subText.
		///</summary><param name="text">
		///The larger text to search within.
		///</param><param name="subText">
		///The sub-text to search for.
		///</param><returns>
		///True if the subtext was found at the start of the given text.
		///</returns>
		public static Microsoft.SmallBasic.Library.Primitive StartsWith(Microsoft.SmallBasic.Library.Primitive text,Microsoft.SmallBasic.Library.Primitive subText)
		{
			return Microsoft.SmallBasic.Library.Text.StartsWith(text,subText);
		}

		///<summary>
		///Gets a sub-text from the given text.
		///</summary><param name="text">
		///The text to derive the sub-text from.
		///</param><param name="start">
		///Specifies where to start from.
		///</param><param name="length">
		///Specifies the length of the sub text.
		///</param><returns>
		///The requested sub-text
		///</returns>
		public static Microsoft.SmallBasic.Library.Primitive GetSubText(Microsoft.SmallBasic.Library.Primitive text,Microsoft.SmallBasic.Library.Primitive start,Microsoft.SmallBasic.Library.Primitive length)
		{
			return Microsoft.SmallBasic.Library.Text.GetSubText(text,start,length);
		}

		///<summary>
		///Gets a sub-text from the given text from a specified position to the end.
		///</summary><param name="text">
		///The text to derive the sub-text from.
		///</param><param name="start">
		///Specifies where to start from.
		///</param><returns>
		///The requested sub-text.
		///</returns>
		public static Microsoft.SmallBasic.Library.Primitive GetSubTextToEnd(Microsoft.SmallBasic.Library.Primitive text,Microsoft.SmallBasic.Library.Primitive start)
		{
			return Microsoft.SmallBasic.Library.Text.GetSubTextToEnd(text,start);
		}

		///<summary>
		///Finds the position where a sub-text appears in the specified text.
		///</summary><param name="text">
		///The text to search in.
		///</param><param name="subText">
		///The text to search for.
		///</param><returns>
		///The position at which the sub-text appears in the specified text.  If the text doesn't appear, it returns 0.
		///</returns>
		public static Microsoft.SmallBasic.Library.Primitive GetIndexOf(Microsoft.SmallBasic.Library.Primitive text,Microsoft.SmallBasic.Library.Primitive subText)
		{
			return Microsoft.SmallBasic.Library.Text.GetIndexOf(text,subText);
		}

		///<summary>
		///Converts the given text to lower case.
		///</summary><param name="text">
		///The text to convert to lower case.
		///</param><returns>
		///The lower case version of the given text.
		///</returns>
		public static Microsoft.SmallBasic.Library.Primitive ConvertToLowerCase(Microsoft.SmallBasic.Library.Primitive text)
		{
			return Microsoft.SmallBasic.Library.Text.ConvertToLowerCase(text);
		}

		///<summary>
		///Converts the given text to upper case.
		///</summary><param name="text">
		///The text to convert to upper case.
		///</param><returns>
		///The upper case version of the given text.
		///</returns>
		public static Microsoft.SmallBasic.Library.Primitive ConvertToUpperCase(Microsoft.SmallBasic.Library.Primitive text)
		{
			return Microsoft.SmallBasic.Library.Text.ConvertToUpperCase(text);
		}

		///<summary>
		///Given the unicode character code, gets the corresponding character, which can then be used with regular text.
		///</summary><param name="characterCode">
		///The character code (Unicode based) for the required character.
		///</param><returns>
		///A unicode character that corresponds to the code specified.
		///</returns>
		public static Microsoft.SmallBasic.Library.Primitive GetCharacter(Microsoft.SmallBasic.Library.Primitive characterCode)
		{
			return Microsoft.SmallBasic.Library.Text.GetCharacter(characterCode);
		}

		///<summary>
		///Given a unicode character, gets the corresponding character code.
		///</summary><param name="character">
		///The character whose code is requested.
		///</param><returns>
		///A unicode based code that corresponds to the character specified.
		///</returns>
		public static Microsoft.SmallBasic.Library.Primitive GetCharacterCode(Microsoft.SmallBasic.Library.Primitive character)
		{
			return Microsoft.SmallBasic.Library.Text.GetCharacterCode(character);
		}

	}
}